package com.penjin.android.activity.geren;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.penjin.android.R;

import cn.sharesdk.framework.ShareSDK;
import cn.sharesdk.onekeyshare.OnekeyShare;

/**
 * Created by fengjw on 2016/4/15.
 */
public class ShareActivity extends Activity implements View.OnClickListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_geren_share);

        Button button = (Button) findViewById(R.id.button);
        button.setOnClickListener(this);

        // showShare();
    }


    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.button:
                showShare();
                break;
        }
    }

    private void showShare() {
        ShareSDK.initSDK(this);
        OnekeyShare onekeyShare = new OnekeyShare();
        onekeyShare.disableSSOWhenAuthorize();
        onekeyShare.setTitle("Share SDK Test !");
        onekeyShare.setText("fengjw test");
        onekeyShare.setUrl("http://sharesdk.cn");
        onekeyShare.setComment(" test");

        onekeyShare.setSite("test");
        onekeyShare.setSiteUrl("http://sharesdk.cn");
        onekeyShare.show(this);
    }


}
